Skip to main content

All Questions

Tagged with
2votes
0answers
74views

backward induction algorithm computation

Is there a way to significantly speed-up this code? I'm solving a dynamic programming model using a backward induction algorithm. A crucial step is to calculate the current-period value function (VF), ...
manifold's user avatar
1vote
1answer
134views

How to using custom colormap with pixel calculation, gray scale value by opencv and make it workable on camera [closed]

I tried to implement the mcolor colormap in the paper at page 8 to 10. I developed the code to process a image file and it works ok. Now, I want to adopt this image processing method to the camera ...
David Lin's user avatar
13votes
5answers
2kviews

Iterate through two arrays calculating a statistic from indexes of zeros

I write a function which takes as input 2 arrays of zeros and ones ~8000 elements per array. Input array size is variable, can have much higher number of elements. The density of ones is expected to ...
skynaive's user avatar
2votes
0answers
140views

Convolution layer using numpy in python

I'm trying to make a CNN in python using numpy. I have a finished product but it seems that it can be improved. On testing the convolutional layer is the biggest bottleneck ...
Rohith's user avatar
5votes
1answer
479views

Bancroft's method implementation

Background I've written an algorithm to solve the three-dimensional Time Difference of Arrival (TDoA) multi-lateration problem. That is, given the coordinates of n ...
10GeV's user avatar
4votes
2answers
2kviews

Trapezoidal rule for set of data

Here is the question from the book of Mark Newman-Computational Physics Exc 5.1 a) Read in the data and, using the trapezoidal rule, calculate from them the approximate distance traveled by the ...
camarman's user avatar
6votes
1answer
944views

Choosing evenly distributed points from a million points on a sphere

I have \$10^5\$ to \$10^6\$ points on a sphere, and want to choose some points from them which are as close as uniformly distributed as possible. For that reason, I do the following: at each step I ...
John's user avatar
  • 309
6votes
1answer
196views

Longest carbon chain

My Code measures the longest path, not allowing cycles. For the example input below, the longest chain would be 4 Please can you review my code? ...
mobo po's user avatar
6votes
1answer
591views

Searching extreme points of polyhedron

In my Uni, my scientific professor asked me to make some researches about the extreme points of polyhedrals. And I did them. I found that there is still no code in public for searching extreme points ...
Andrey Lovyagin's user avatar
2votes
1answer
322views

Retrieval of the corners of a mask

I have trained a polygon detector neural network to recognize the mask of "quadrilateral" (the mask generates curvy lines so it's not exactly a quadrilateral). I would like to get the corners of the ...
Seth Kitchen's user avatar
3votes
0answers
543views

Locality Sensitive Hash (similar to k-Nearest Neighbor), in Python+Numpy

I've tried implementing Locality Sensitive Hash, the algorithm that helps recommendation engines, and powers apps like Shazzam that can identify songs you heard at restaurants. LSH is supposed to run ...
Josh.F's user avatar
6votes
1answer
89views

Optimal algorithm to move a a rope from one position to another

I'm an engineer working with a deformable membrane that is attached to actuators. The goal is to move the membrane from one shape to another, without ripping the membrane. This imposes "neighbor ...
Mike's user avatar
  • 161
4votes
0answers
3kviews

Distance transform on image using NumPy

I would like to find the find the distance transform of a binary image in the fastest way possible without using the scipy function distance_transform_edt(). The ...
user186901's user avatar
6votes
1answer
4kviews

Rotating an Image using own algorithm in python

For an uni assignment I have been giving the task of making my own rotating algorithm in python. This is my code so far. ...
ACommonDane01's user avatar
4votes
1answer
11kviews

Simplex method (linear programming) implementation

The up-to-date code, along some documentation, can be found here. We've implemented a version of the Simplex method for solving linear programming problems. The concerns I have are with the design we ...
Anakhand's user avatar

153050per page
close